<div class="adminMessages">
    <div class="messagesNavigation">
        <ul>
            <li class="<?php echo ($this->uri->segment(5)=='all')?'mSelected':'nSelected'?>"><a href="<?php echo base_url()."mk/admin/messages/listmessages/all"?>"><?php echo lang('all_messages')?></a></li>
            <li class="<?php echo ($this->uri->segment(5)=='1')?'mSelected':'nSelected'?>"><a href="<?php echo base_url()."mk/admin/messages/listmessages/1"?>"><?php echo lang('unapproved_messages')?></a></li>
            <li class="<?php echo ($this->uri->segment(5)=='2')?'mSelected':'nSelected'?>"><a href="<?php echo base_url()."mk/admin/messages/listmessages/2"?>"><?php echo lang('approved_messages')?></a></li>
            <li class="<?php echo ($this->uri->segment(5)=='0')?'mSelected':'nSelected'?>"><a href="<?php echo base_url()."mk/admin/messages/listmessages/0"?>"><?php echo lang('inactive_messages')?></a></li>
            <li class="<?php echo ($this->uri->segment(5)=='3')?'mSelected':'nSelected'?>"><a href="<?php echo base_url()."mk/admin/messages/listmessages/3"?>"><?php echo lang('answered_messages')?></a></li>
        </ul>
        <div class="cleardiv"></div>
    </div>
    <div class="messagesHolder">
        <table>
            <tr>
                <th><?php echo lang('id_messages')?></th>
                <th><?php echo lang('message')?></th>
                <th><?php echo lang('answer')?></th>
                <th><?php echo lang('sender')?></th>
                <th><?php echo lang('status')?></th>
                <th><?php echo lang('action')?></th>
            </tr>
            <?php
                foreach ($allMessages as $key=>$message) {
                ?>
            <tr>
                <td><?php echo $message->message_id;?></td>
                <td><?php echo word_limiter($message->message,10)?><a href="<?php echo base_url()."mk/admin/messages/approveMessages/".$message->message_id?>"><img src="<?php echo base_url()."style/images/text.png";?>" alt="Read More"></a></td>
                <td><?php echo "treba da ide odgovort"?></td>
                <td><?php echo $message->sender_name.", ".$message->sender_email?></td>
                <td><?php echo $rep_answers[$message->message_id][0]->message_status;?></td>
                <td align="center">
                    <?php
                        if($rep_answers[$message->message_id][0]->message_status==0 || $rep_answers[$message->message_id][0]->message_status==1){
                            ?>
                        <a href="<?php echo base_url()."mk/admin/messages/approveMessages/".$message->message_id?>"><img src="<?php echo base_url()."style/images/accepted16x16.png";?>" alt="Approve"></a>
                    <?php
                        }
                    ?>
                    <a href="<?php echo base_url()."mk/admin/messages/deleteMessage/".$message->message_id?>"><img src="<?php echo base_url()."style/images/cancel.png";?>" alt="Delete"></a>
                </td>
            </tr>
            <?php
            }
            ?>
        </table>
    </div>
</div>
